<%--
  Created by IntelliJ IDEA.
  User: 11576
  Date: 2022/12/26
  Time: 12:38
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" isELIgnored="false" %>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
<html>
<head>
    <meta charset="utf-8">
    <title>品牌管理</title>
</head>
<body>
<div>
    <form action="${pageContext.request.contextPath}/back/brandSelectByCategoryId" method="post">
        分类查询：
        <select name="category_id">
            <c:forEach items="${categoryList}" varStatus="categoryStatus" var="category">
                <option value="${category.category_id}">${category.category_name}</option>
            </c:forEach>
        </select>
        <input type="submit" value="查询">
    </form>
</div>
    <form action="${pageContext.request.contextPath}/back/brandDel" method="post">
        <div>
            <a href="error.jsp"><input type="button" value="添加品牌"></a>
            <input type="submit" value="批量删除">
            <div>共：${fn:length(brandList)}个品牌</div>
        </div>
    <table border="1px" width="800px" cellspacing="0px" cellpadding="5px">
        <thead>
        <tr>
            <th><input type="checkbox" name="all"></th>
            <th>ID</th>
            <th>品牌LOGO</th>
            <th>品牌名称</th>
            <th>描述</th>
            <th>加入时间</th>
            <th>状态</th>
            <th>操作</th>
        </tr>
        </thead>
        <tbody>
        <c:forEach items="${brandList}" varStatus="brandStatus" var="brand">
            <tr align="center">
                <td><input type="checkbox" name="brand_id" value="${brand.brand_id}"></td>
                <td>${brand.brand_id}</td>
                <td>${brand.brand_logo}</td>
                <td>${brand.brand_name}</td>
                <td>${brand.brand_desc}</td>
                <td>${brand.create_time}</td>
                <td>${brand.brand_status==1?"已启用":"已停用"}</td>
                <td>
                    <a href="">停用</a>
                    <a href="">编辑</a>
                    <a href="">删除</a>
                </td>
            </tr>
        </c:forEach>
        </tbody>
    </table>
</form>
</body>
</html>
